<?php

class Seo extends ActiveRecordBase
{

	public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

	public function tableName() {
		return "{{seo}}";
	}

	public function rules()
	{
		return array(
			array('seo_name, object_id, object_type', 'required'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'seo_name' => t('SEO Name'),
			'object_id' => t('Object ID'),
			'object_type' => t('Object Type'),
		);
	}

	static public function ObjectTypeTranslate($object_type) {

		$types = array(
			'P' => t('Product'),
			'C' => t('Category'),
			'A' => t('App'),
		);

		return isset($types[$object_type]) ? $types[$object_type] : 'Unknown';
	}
}